import 'package:flutter/material.dart';

class HomeNav extends StatelessWidget {
  const HomeNav({super.key});

  @override
  Widget build(BuildContext context) {
    List list = [
      {
        'title': '我的房屋',
        "icon": "assets/images/house_profile_icon@2x.png",
      },
      {
        'title': '我的报修',
        "icon": "assets/images/repair_profile_icon@2x.png",
      },
      {
        'title': '方可登记',
        "icon": "assets/images/visitor_profile_icon@2x.png",
      }
    ];
    List<Widget> getNavList() {
      return list.map((item) {
        return Expanded(
            child: Column(
          children: [
            Image.asset(
              item['icon'],
              width: 35,
              height: 35,
            ),
            Text(item['title'])
          ],
        ));
      }).toList();
    }

    return Container(
      margin: const EdgeInsets.only(top: 10, bottom: 10),
      padding: const EdgeInsets.only(top: 10, bottom: 10),
      decoration: const BoxDecoration(
          color: Colors.white,
          borderRadius: BorderRadius.all(Radius.circular(10))),
      child: Row(
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
        children: getNavList(),
      ),
    );
  }
}
